﻿<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
	<meta charset="utf-8" />
</head>
<body>
    <a href="3100.jpg">图片1</a>
    <a href="ImageHandler.ashx?action=GetFile">txt下载</a>
    <a href="ImageHandler.ashx?action=Getimag">图片下载</a>
    <!--<a href="Picture.html">图片防盗</a>-->
   <div>
       
       <img src="Picture.html" title="图片防盗" />
   </div>
    <div id="imgcontainer"> 

    </div>
   
</body>
</html>
<script src="Scripts/jquery-1.10.2.min.js"></script>

<script>
    debugger
    var url = "ImageHandler.ashx?action=GetCe&name=周继伦";
    var xhr = new XMLHttpRequest();
    xhr.open("get", url, true);
    xhr.responseType = "blob";
    xhr.onload = function () {
        debugger
        if (this.status == 200) {
            var blob = this.response;
            var img = document.createElement("img");
            img.onload = function (e) {
                window.URL.revokeObjectURL(img.src);
            };
            img.src = window.URL.createObjectURL(blob);
            $("#imgcontainer").html(img);
        }
    }
    xhr.send();
</script>
<script>
  
    debugger
    var url = "HelloHttpHandler.cs?action=GetCe&name=周继伦";
    $.ajax({
        url: url,
        type: "post",
        data: {},
        datatype: "json",
        success: function (data) {
            debugger
        }, error: function (data) {
            debugger
        }
    })
</script>